<template>
  <div>

  </div>
</template>

<script type="text/ecmascript-6">
  import { Indicator,Toast  } from 'mint-ui'
  import api from '../../api/http.js'
  import url from '../../api/urlConst.js'
  import { config } from '../../common/js/weChat/service.js'
  export default {
    components: {},
    data() {
      return {
        weChatShareVo: {},
      }
    },
    created() {
      this.getWeChatShareVo()
    },
    methods:{
      getWeChatShareVo(){
        api.post(url.questions.weChatShareVo).then((res) => {
          if (res.success) {
            this.weChatShareVo = res.data
            setTimeout(() => {
              this._weChatConfig()
            }, 300)
          }
        })
      },
      _weChatConfig () {
        let param = {
          pageUrl: location.href
        }
        api.get(url.weChat.getJsapiSignature, param).then((res) => {
          if (res.success) {
            let link = this.weChatShareVo.shareUrl + '?v=2'
            let imgUrl = this.weChatShareVo.shareImgUrl
            let title = this.weChatShareVo.shareTitle
            let desc = this.weChatShareVo.shareDesc
            config(res.data, link, imgUrl, title, desc)
          }

        })
      },
    }
  }
</script>

<style scoped>



</style>
